#@bootStrapLayout("商户管理信息界面-编辑")
#define bootStrapMain()
<div class="container">
    #include("../../common/header.html")
    <div class="col-md-12">
        <ol class="breadcrumb">
            <li><a href="#">主页</a></li>
            <li class="active">编辑</li>
            <li></li>
        </ol>
    </div>

    <div class="col-md-12" >
        <div class="col-md-6 col-md-offset-1">
            <form class="form-horizontal" id="submitForm">
                #include("deliveryconfig-form.html")
            </form>
        </div>
    </div>
</div>
#end


#define bootStrapCss()
#end

#define bootStrapJs()
    <script>

       $(document).ready(function () {
           var area="#(deliveryConfig.area)";
           var $check_boxes = $("input[name='area']");

           var arr = area.split(",");
           for(var i=0;i<arr.length;i++){
               $check_boxes.each(function() {
                   var current = $(this).val();
                   if(current==arr[i]){
                       $(this).prop("checked",true);
                   }
               });
           }
           $("#selectAll").change(function(){
               var isSelected = $(this).prop("checked");
               if(isSelected){
                   $("input[name='area']").prop("checked",true);
               }else{
                   $("input[name='area']").prop("checked",false);
               }
           })
           $("#submitBtn").click(function(){
               $.ajax({
                   "url":"#(contextPath)/travel/deliveryConfig/doUpdate",
                   "method":"post",
                   "data":$("#submitForm").serialize(),
                   "success":function (resp) {
                       if(resp.result){
                           layer.msg(resp.data);
                           window.location.reload();
                       }else{
                           layer.msg(resp.data);
                       }
                   }
               })
           })
       })
    </script>
#end
